<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link href="assets/css/bootstrap.min.css" rel="stylesheet" />
  <link rel="stylesheet" href="assets/css/ace.min.css" />
  <link rel="stylesheet" href="css/style.css"/>
    <link rel="stylesheet" href="assets/css/font-awesome.min.css" />
  <!--[if IE 7]>
    <link rel="stylesheet" href="assets/css/font-awesome-ie7.min.css" />
  <![endif]-->
    <script type="text/javascript" src="js/vue.min.js"></script>
    <script type="text/javascript" src="js/axios.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
<title>暂存项目</title>
</head>

<body>
<div id="app">
<div class="page-content">
 <div class="Manager_style">
  <span class="title_name">暂存项目</span>
  <div class="TP_storage ">
   <table class="table table-striped table-bordered table-hover">
    <thead>
     <tr>
      <th>序号</th>
      <th>项目名称</th>
      <th>暂存到期时间</th>
      <th>操作</th>
     </tr>
    </thead>
    <tbody>
    <tr v-for="i in zData">
        <td>{{i.o_id}}</td>
        <td>{{i.project_name}}</td>
        <td>{{i.cut_time}}</td>
         <td><a class="btn btn-warning" type="button" href="#" @click.prevent="edit(i.o_id,i.m_id)">编辑</a></td>
     </tr>
    </tbody>
   </table>
    <div class="page_style">
        <div class="page_style">
            <div class="block">
                <span class="demonstration">完整功能</span>
                <el-pagination
                        @size-change="handleSizeChange"
                        @current-change="handleCurrentChange"
                        :current-page="page"
                        :page-sizes="[10, 15, 20]"
                        :pageSize="10"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total=total>
                </el-pagination>
            </div>
        </div>
  </div>
  </div>
 </div>
</div>
</div>
<script>
    new Vue({
        el:"#app",
        data:{
            //总数据
            zData:[],

            //搜索对象
            searchObj:{
                o_type:'暂存',
                project_name:'',
                o_number:'',
                prime_date:''
            },
            //当前页数
            page:1,
            //每页显示数
            pageSize:10,
            //总条目数
            total:0,
            //搜索状态
            searchStatus:false,

        },
        methods:{
            getInfo(){
                axios.get("orders/暂存/"+(this.page-1)*this.pageSize+"/"+this.pageSize+"/ordersType.do").then(dt => {
                    console.log(dt.data)
                    this.zData = [];
                    for (let i = 0; i < dt.data.length; i++) {
                        let comData = {
                            o_id: dt.data[i].o_id,
                            project_name: dt.data[i].project_name,
                            o_number: dt.data[i].o_number,
                            prime_date: dt.data[i].prime_date,
                            place: dt.data[i].place,
                            boat_name: dt.data[i].boat_name,
                            m_id: dt.data[i].m_id,
                            cut_time: dt.data[i].cut_time,
                        };
                        this.zData.push(comData);
                    }
                })
            },
            handleSizeChange(val) {
                this.pageSize=val
                this.getInfo()
            },
            handleCurrentChange(val) {
                this.page=val
                this.getInfo()
            },
            searchAll(){
                if (this.searchObj.project_name.trim() !== '' | this.searchObj.o_number.trim() !== '' || this.searchObj.prime_date.trim() !== '') {
                    axios.get("orders/searchAll.do", {
                        params: this.searchObj
                    })
                        .then(dt => {
                            this.searchStatus=true
                            this.zData = [];
                            for (let i = 0; i < dt.data.length; i++) {
                                let comData = {
                                    o_id: dt.data[i].o_id,
                                    project_name: dt.data[i].project_name,
                                    o_number: dt.data[i].o_number,
                                    prime_date: dt.data[i].prime_date,
                                    place: dt.data[i].place,
                                    boat_name: dt.data[i].boat_name,
                                    m_id:dt.date[i].m_id,
                                    cut_time: dt.data[i].cut_time,
                                };
                                this.zData.push(comData);
                            }
                        })
                } else {
                    this.$message({
                        type: 'info',
                        message: '您还没有输入值'
                    });
                }
            },
            edit(o_id,m_id){
                location.href="项目立项.html?o_id="+o_id+"&m_id="+m_id;
            }

        },
        mounted(){
            axios.get("orders/暂存/total.do").then(dt =>{
                this.total=dt.data
            })
            this.getInfo();
        }
    })
</script>
</body>
</html>
